<?php
class ImageWidget extends CWidget{
    
    public $product_id;
    
    public function run() {
        parent::run();
        $model = new Image();
        $model->product_id = $this->product_id;
        //get all banner
        $criteria = new CDbCriteria();
        $criteria->addCondition("product_id=:product_id");
        $criteria->params = array(':product_id' => $this->product_id);
        $images = Image::model()->findAll($criteria,array('order' => 'orders ASC'));
        $this->render('addImage',array('images' => $images,'model' => $model));
    }
}
